-
Notifications
You must be signed in to change notification settings - Fork 63
Adding lakebase short term memory blog post #70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Adding lakebase short term memory blog post #70
Conversation
| ### Prerequisites | ||
|
|
||
| 1. **Databricks Workspace** with Unity Catalog enabled | ||
| 2. **Lakebase Instance** - Create via SQL Warehouses → Lakebase Postgres → Create database instance |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why via SQL? Should this be via "Compute"?
|
|
||
| # TODO: Update with your system prompt | ||
| SYSTEM_PROMPT = """ | ||
| You are an cybersecurity assistant. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"a cybersecurity"
| """Stateful agent using ResponsesAgent with pooled Lakebase checkpointing.""" | ||
|
|
||
| def __init__(self, lakebase_config: dict[str, Any]): | ||
| self.workspace_client = WorkspaceClient() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unused?
| # Lakebase configuration | ||
| ############################################ | ||
| # TODO: Fill in Lakebase instance name | ||
| LAKEBASE_INSTANCE_NAME = "bo-test-lakebase-3" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of hardcoding, maybe get from env?
|
|
||
| # Example UC tools; add your own as needed | ||
| UC_TOOL_NAMES: list[str] = [ | ||
| "bo_cheng_dnb_demos.agents.get_cyber_threat_info", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hardcoded values, consider parametrizing
| " FROM\n", | ||
| " bo_cheng_dnb_demos.agents.cyber_threat_detection\n", | ||
| " WHERE\n", | ||
| " threat_type = threat_type\n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Always true?
| "output_type": "execute_result", | ||
| "data": { | ||
| "text/plain": [ | ||
| "DatabaseInstance(name='bo-test-lakebase-3', capacity='CU_1', child_instance_refs=[], creation_time='2026-01-08T19:16:22Z', creator='[email protected]', custom_tags=[], effective_capacity='CU_1', effective_custom_tags=[], effective_enable_pg_native_login=True, effective_enable_readable_secondaries=False, effective_node_count=1, effective_retention_window_in_days=7, effective_stopped=False, effective_usage_policy_id=None, enable_pg_native_login=None, enable_readable_secondaries=None, node_count=None, parent_instance_ref=None, pg_version='PG_VERSION_16', read_only_dns='instance-ro-cd00746e-b544-45c8-9f08-5062a0858c7d.database.cloud.databricks.com', read_write_dns='instance-cd00746e-b544-45c8-9f08-5062a0858c7d.database.cloud.databricks.com', retention_window_in_days=None, state=<DatabaseInstanceState.AVAILABLE: 'AVAILABLE'>, stopped=None, uid='cd00746e-b544-45c8-9f08-5062a0858c7d', usage_policy_id=None)" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hardcoded value, consider parametrizing
| @@ -0,0 +1,3 @@ | |||
| mlflow>=2.21.2 | |||
| streamlit==1.44.1 | |||
| databricks-sdk | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider pinning version
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove if unused
No description provided.